package com.smh.mp.mapper;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.smh.mp.domain.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Update("update `mybatis-plus-demo`.tb_user set balance = balance - #{money} ${ew.customSqlSegment}")
    void reduceMoneyById(@Param(Constants.WRAPPER) LambdaUpdateWrapper wrapper, Integer money);

    //这里一定不要忘了加注解@Param("ew")
//    void updateCustom(@Param(Constants.WRAPPER) LambdaUpdateWrapper wrapper, int number);
}
